/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.jfonia.constants;

import java.util.HashMap;
import java.util.Map;
import org.jfonia.model.elements.Clef;
import org.jfonia.model.elements.KeySignature;
import org.jfonia.model.elements.TimeSignature;
import org.jfonia.notation.Bar;
import org.jfonia.notation.ObservableNote;
import org.jfonia.notation.ObservableRest;

/**
 *
 * @author Rik Bauwens
 */
public class SymbolConstants
{
        //Priority used when symbols are drawn (high to low)
        public final static Map<Class, Integer> staffSymbolPriority = new HashMap<Class, Integer>() {{
               put(Bar.class, 0);
               put(Clef.class, 1);
               put(KeySignature.class, 2);
               put(TimeSignature.class, 3);
               put(ObservableNote.class, 4);
               put(ObservableRest.class, 4);
        }};
        //public final static Class staffSymbolPriority[] =
            //{Bar.class, Clef.class, KeySignature.class, TimeSignature.class, Note.class};
        public final static int SYMBOL_SIZE = 30;
        public final static double SYMBOL_SPACING = 1.5;

        //Notehead
        public final static int NOTEHEAD_LONGA = 768;
        public final static int NOTEHEAD_BREVE = 384;
        public final static int NOTEHEAD_SEMIBREVE = 192;
        public final static int NOTEHEAD_MINIM = 96;
        public final static int NOTEHEAD_CROTCHET = 48;
        public final static int NOTEHEAD_QUAVER = 24;
        public final static int NOTEHEAD_SEMIQUAVER = 12;
        public final static int NOTEHEAD_DEMISEMIQUAVER = 6;
        public final static int NOTEHEAD_HEMIDEMISEMIQUAVER = 3;
        //public final static int NOTEHEAD_QUASIHEMIDEMISEMIQUAVER = 1;

        public final static String NOTEHEAD_1 = "notehead1";
        public final static String NOTEHEAD_1_2 = "notehead1/2";
        public final static String NOTEHEAD_1_4 = "notehead1/4";

        //Rest
        public final static int REST_RANK = 4;

        public final static int REST_SEMIBREVE = 192;
        public final static int REST_MINIM = 96;
        public final static int REST_CROTCHET = 48;
        public final static int REST_QUAVER = 24;
        public final static int REST_SEMIQUAVER = 12;
        public final static int REST_DEMISEMIQUAVER = 6;

        public final static String REST_1 = "rest1";
        public final static String REST_1_2 = "rest1/2";
        public final static String REST_1_4 = "rest1/4";
        public final static String REST_1_8 = "rest1/8";
        public final static String REST_1_16 = "rest1/16";
        public final static String REST_1_32 = "rest1/32";

        //Dot
        public final static String DOT = "dot";

        //Stem
        public final static int STEM_DIRECTION_SWITCH = 4;
        public final static int STEM_DIRECTION_DOWN = -1;
        public final static int STEM_DIRECTION_UP = 1;
        public final static float STEM_WIDTH = 1f;//0.16f;
        public final static double STEM_LENGTH = 20.0;

        public final static int STEM_LONGA = 768;
        public final static int STEM_BREVE = 384;
        public final static int STEM_SEMIBREVE = 192;
        public final static int STEM_MINIM = 96;
        public final static int STEM_CROTCHET = 48;
        public final static int STEM_QUAVER = 24;
        public final static int STEM_SEMIQUAVER = 12;
        public final static int STEM_DEMISEMIQUAVER = 6;
        public final static int STEM_HEMIDEMISEMIQUAVER = 3;
        //public final static int NOTEHEAD_QUASIHEMIDEMISEMIQUAVER = 1;

        //Flag
        public final static int FLAG_STEM_DOWN = -1;
        public final static int FLAG_STEM_UP = 1;
        //Which notehead (corresponding musicaltime) gets the first flag -> Quaver (24)
        public final static int FLAG_FIRST = 24;
        public final static String FLAG_STEM_UP_1_8 = "flagstemup1/8";
        public final static String FLAG_STEM_DOWN_1_8 = "flagstemdown1/8";
        public final static double FLAG_SPACING = 5.0;

        //Accidental
        public final static int ACCIDENTAL_DOUBLE_FLAT = -2;
        public final static int ACCIDENTAL_FLAT = -1;
        public final static int ACCIDENTAL_NATURAL = 0;
        public final static int ACCIDENTAL_SHARP = 1;
        public final static int ACCIDENTAL_DOUBLE_SHARP = 2;

        public final static String ACC_DOUBLE_FLAT = "accDoubleFlat";
        public final static String ACC_FLAT = "accFlat";
        public final static String ACC_NATURAL = "accNatural";
        public final static String ACC_SHARP = "accSharp";
        public final static String ACC_DOUBLE_SHARP = "accDoubleSharp";

        //Clef
        public final static int G_CLEF_TREBLE = 0;
        public final static int G_CLEF_FRENCH = 1;
        public final static int F_CLEF_BASS = 2;
        public final static int F_CLEF_BARITONE = 3;
        public final static int F_CLEF_SUBBASS = 4;
        public final static int C_CLEF_ALTO = 5;
        public final static int C_CLEF_TENOR = 6;
        public final static int C_CLEF_BARITONE = 7;
        public final static int C_CLEF_MEZZOSOPRANO = 8;
        public final static int C_CLEF_SOPRANO = 9;

        public final static String G_CLEF = "clefG";
        public final static String F_CLEF = "clefF";
        public final static String C_CLEF = "clefC";
        public final static String G_MINUS8_CLEF = "clefGminus8";
        public final static String G_PLUS8_CLEF = "clefGplus8";
        public final static String F_MINUS8_CLEF = "clefFminus8";
        public final static String F_PLUS8_CLEF = "clefFplus8";

        public final static int RANK[] = {2, 0, 6, 4, 8, 4, 6, 8, 2, 0};

        //Key signature
        public final static int KEY_SIGNATURE_RANK = 4;

        //Time signature
        public final static int NOMINATOR_RANK = 6;
        public final static int DENOMINATOR_RANK = 2;

        //Digit
        public final static double DIGIT_SPACING = 0.1;
        public final static String DIGIT = "digit";

        public final static int DIVISOR = 192;
        public final static int MULTIPLIER = 2;

        //Slur
        public final static double SLUR_SPACING = 1.0;
        public final static double SLUR_HEIGHT = 10.0;
        public final static double SLUR_THICKNESS = 6.0;

        //Legder line
        public final static double LEDGER_LINE_PRE_SPACING = 1.0;
        public final static double LEDGER_LINE_POST_SPACING = 1.0;

        //Bar
        public final static int SINGLE_BAR = 1;
        public final static int DOUBLE_BAR = 2;
        public final static float THIN_BAR_WIDTH = 1;
        public final static float THICK_BAR_WIDTH = 2;
        public final static double BAR_SPACING = 1.5;


}
